package lucius.work.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import lucius.work.dao.impl.BaseDao;
import lucius.work.service.IBaseService;

@Service("baseService")
public class BaseService<T> implements IBaseService<T>{

	@Autowired
	private BaseDao<T> baseDao;

	

	@Override
	public void add(T t) {
		baseDao.save(t);
	}

	@Override
	public List<T> findAll(Class<T> clazz) {

		return baseDao.findAll(clazz);
	}

	@Override
	public void update(T t) {

		baseDao.update(t);
		
	}

	@Override
	public void delete(T t) {

		baseDao.delete(t);
		
	}

	@Override
	public T getById(Class<T> clazz, Integer id) {
		
		return baseDao.get(clazz, id);
	}

}
